package com.google.zxing.multi;

import com.google.zxing.BinaryBitmap;
import com.google.zxing.ChecksumException;
import com.google.zxing.DecodeHintType;
import com.google.zxing.FormatException;
import com.google.zxing.NotFoundException;
import com.google.zxing.Reader;
import com.google.zxing.Result;
import com.google.zxing.ResultPoint;
import java.util.Map;

public final class ByQuadrantReader
  implements Reader
{
  private final Reader delegate;

  public ByQuadrantReader(Reader paramReader)
  {
    this.delegate = paramReader;
  }

  private static void makeAbsolute(ResultPoint[] paramArrayOfResultPoint, int paramInt1, int paramInt2)
  {
    if (paramArrayOfResultPoint != null)
      for (int i = 0; i < paramArrayOfResultPoint.length; i++)
      {
        ResultPoint localResultPoint = paramArrayOfResultPoint[i];
        paramArrayOfResultPoint[i] = new ResultPoint(localResultPoint.getX() + paramInt1, localResultPoint.getY() + paramInt2);
      }
  }

  public Result decode(BinaryBitmap paramBinaryBitmap)
    throws NotFoundException, ChecksumException, FormatException
  {
    return decode(paramBinaryBitmap, null);
  }

  public Result decode(BinaryBitmap paramBinaryBitmap, Map<DecodeHintType, ?> paramMap)
    throws NotFoundException, ChecksumException, FormatException
  {
    int i = paramBinaryBitmap.getWidth();
    int j = paramBinaryBitmap.getHeight();
    int k = i / 2;
    int m = j / 2;
    try
    {
      Result localResult5 = this.delegate.decode(paramBinaryBitmap.crop(0, 0, k, m), paramMap);
      return localResult5;
    }
    catch (NotFoundException localNotFoundException1)
    {
      try
      {
        Result localResult4 = this.delegate.decode(paramBinaryBitmap.crop(k, 0, k, m), paramMap);
        makeAbsolute(localResult4.getResultPoints(), k, 0);
        return localResult4;
      }
      catch (NotFoundException localNotFoundException2)
      {
        try
        {
          Result localResult3 = this.delegate.decode(paramBinaryBitmap.crop(0, m, k, m), paramMap);
          makeAbsolute(localResult3.getResultPoints(), 0, m);
          return localResult3;
        }
        catch (NotFoundException localNotFoundException3)
        {
          try
          {
            Result localResult2 = this.delegate.decode(paramBinaryBitmap.crop(k, m, k, m), paramMap);
            makeAbsolute(localResult2.getResultPoints(), k, m);
            return localResult2;
          }
          catch (NotFoundException localNotFoundException4)
          {
            int n = k / 2;
            int i1 = m / 2;
            BinaryBitmap localBinaryBitmap = paramBinaryBitmap.crop(n, i1, k, m);
            Result localResult1 = this.delegate.decode(localBinaryBitmap, paramMap);
            makeAbsolute(localResult1.getResultPoints(), n, i1);
            return localResult1;
          }
        }
      }
    }
  }

  public void reset()
  {
    this.delegate.reset();
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.google.zxing.multi.ByQuadrantReader
 * JD-Core Version:    0.6.2
 */